import request from '@/api/request.js'

// 分页获取动态
export function getTrends(params) {
	return request({
		url: '/trend',
		method: 'get',
		headers: {
		  isToken: "0"
		},
		params: params
	})
}

// 动态点赞
export function likeTrend(params) {
	return request({
		url: '/trend/like',
		method: 'post',
		headers: {
		  isToken: "0"
		},
		params:params
	})
}

// 动态收藏
export function collectTrend(params) {
	return request({
		url: '/trend/collect',
		method: 'post',
		headers: {
		  isToken: "0"
		},
		params:params
	})
}

// 获取动态详情
export function getTrendDetail(trendId) {
	return request({
		url: '/trend/' + trendId,
		method: 'get',
		headers: {
		  isToken: "0"
		}
	})
}

// 获取标签列表
export function getAllTags() {
	return request({
		url: '/tag/all',
		method: 'get',
		headers: {
		  isToken: "1"
		}
	})
}

// 获取动态评论
export function getCommentsByTrendId(trendId) {
	return request({
		url: '/comment/' + trendId,
		method: 'get',
		headers: {
		  isToken: "1"
		}
	})
}


// 发布动态
export function publishTrend(trendDTO) {
	return request({
		url: 'trend/publish',
		method: 'post',
		headers: {
		  isToken: "0"
		},
		data: trendDTO
	})
}
